﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WMS.Model
{
    [SugarTable("Avatar")]
    public class AvatarModel : BaseModel
    {
        /// <summary>
        /// 关联的编码
        /// </summary>
        [SugarColumn(ColumnName = "Code", IsNullable = false, Length = 200)]
        public string Code { get; set; }

        /// <summary>
        /// MinIO头像访问地址
        /// </summary>
        [SugarColumn(ColumnName = "AvatarUrl", Length = 500, IsNullable = false)]
        public string AvatarUrl { get; set; }

        /// <summary>
        /// 原始文件名
        /// </summary>
        [SugarColumn(ColumnName = "FileName", Length = 255, IsNullable = false)]
        public string FileName { get; set; }

        /// <summary>
        /// 文件大小（字节）
        /// </summary>
        [SugarColumn(ColumnName = "FileSize", IsNullable = true)]
        public long? FileSize { get; set; }

        /// <summary>
        /// 文件MIME类型
        /// </summary>
        [SugarColumn(ColumnName = "MimeType", Length = 100, IsNullable = true)]
        public string? MimeType { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [SugarColumn(ColumnName = "CreatedTime")]
        public DateTime CreatedTime { get; set; } = DateTime.Now;

        /// <summary>
        /// 状态：0-禁用，1-启用
        /// </summary>
        [SugarColumn(ColumnName = "Status")]
        public byte? Status { get; set; } = 1;
    }

    public class AvatarUploadResult
    {
        public bool Success { get; set; }
        public string Message { get; set; }
        public string AvatarUrl { get; set; }
    }
}
